package cn.usian.mapper;

import cn.usian.pojo.Daily;
import cn.usian.vo.DailyVo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.*;

@Mapper
public interface DailyVoMapper extends BaseMapper<DailyVo> {

    Page<DailyVo> findPage(Page<DailyVo> page,@Param("dai") Daily daily);

    @Insert("insert into tb_daily value (null,#{createTime},'小黑',#{pid},#{today},#{tomorrow})")
    void add(Daily daily);

    @Update("update tb_daily set create_time=#{createTime},pid=#{pid},today=#{today},tomorrow=#{tomorrow} where id=#{id}")
    void updateDaily(Daily daily);

    @Select("select * from tb_daily where id=#{id}")
    Daily findDaylyById(Integer id);
}
